import request from '@/utils/request'

// 分页查询试卷信息
export function queryPapersByPage(params) {
  return request({
    url: '/api/paper',
    method: 'get',
    params
  })
}

// 添加试卷信息
export function addPaper(data) {
  return request({
    url: '/api/paper',
    method: 'post',
    data
  })
}

// 移除试卷信息
export function removePaper(id) {
  return request({
    url: `/api/paper/${id}`,
    method: 'delete'
  })
}

//  删除一些试卷信息
export function removePapers(params) {
  return request({
    url: '/api/paper/batch',
    method: 'delete',
    params
  })
}

//  更新试卷信息
export function updatePaper(data) {
  return request({
    url: '/api/paper',
    method: 'put',
    data
  })
}

// 获得试卷
export function getPaper(id) {
  return request({
    url: `/api/paper/${id}`,
    method: 'get'
  })
}
